import config from "../config/config";
import {
  HTTP
} from "../utils/http";

class AuthService extends HTTP {
  getAccessToken() {
    return this.get({
      url: "/auth/accessToken"
    });
  }

  login(code) {
    return this.post({
      url: "/auth/login",
      data: {
        code,
        appId: config.appId,
      },
      needAuth: false,
    });
  }

  getCosTempKey() {
    return this.get({
      url: `/user/:userId/sts`
    });
  }
}

export {
  AuthService
};